package test24;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-12-14
 * Time: 19:48
 */
public abstract class Goods {
    public abstract void sell();
}

class Book extends Goods{
    @Override
    public void sell() {
        System.out.println("sell books");
    }
}

class Clothes extends Goods{
    @Override
    public void sell() {
        System.out.println("sell Clothes");
    }
}

class Shoes extends Goods{
    @Override
    public void sell() {
        System.out.println("sell Shoes");
    }
}

class GoodsSeller {
    public void sellGoods(List<Goods> list){
        for (Goods goods:list) {
            goods.sell();
        }
    }

}